import { createRouter, createWebHashHistory } from 'vue-router';

import LayoutView from '../views/LayoutView.vue';
import HomeView from '../views/HomeView.vue';

const routes = [
  {
    path: '/',
    redirect: { name: 'home' },
  },
  {
    path: '/home',
    name: 'home',
    redirect: { name: 'homeIndex' },
    component: LayoutView,
    children: [
      {
        path: 'index',
        name: 'homeIndex',
        component: HomeView,
        meta: {
          title: 'XXXXX',
        },
      },
    ],
  },

  {
    path: '/abc',
    name: 'abc',
    redirect: { name: 'abcIndex' },
    component: LayoutView,
    children: [
      {
        path: 'index',
        name: 'abcIndex',
        component: HomeView,
        meta: {
          title: '****',
        },
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
